#ifndef GKO_POOL_INCLUDE_GP_LOG_H
#define GKO_POOL_INCLUDE_GP_LOG_H

#include <cstdio>
#include <cerrno>
#include <cstdlib>
#include <ctime>
#include <cstring>

#include <unistd.h>
#include <stdarg.h>
#include <sys/types.h>

static const u_int8_t FATAL = 0; // log fatal
static const u_int8_t WARNING = 1; // log warn
static const u_int8_t NOTICE = 2; // log notice
static const u_int8_t TRACE = 3; // log trace
static const u_int8_t DEBUG = 4; // log debug

/// @desc: FLF stands for file line func
// CONF: use case 1 or case 2, not ok both set 
#define FLF(a) "{%s:%d %s} %s", __FILE__, __LINE__, __func__, #a 
// #define FLF(a) a

/// @desc: funcs for log handler
void gko_log_flf(const u_int8_t log_level, const char* file
                 const char* func, const char* func, const char* fmt, ...);

int lock_log(void);
int unlock_log(void);
int reinit_log_lock(void);

#endif // header file protect
// END: CODEREVIEW: